package Auction;

import java.util.ArrayList;
import java.util.Iterator;

public class Right_group_auction {
	
	ArrayList<String> name = new ArrayList<>();
	double price;
	boolean visited;
	int number;
	
	public Right_group_auction(){
		
	}
	
	public Right_group_auction(int n){
		number = n;
	}
	
	public void setNumber(int number) {
		this.number = number;
	}
	
	public void addprice(String str, double p){
		if(!this.name.contains(str))
			this.name.add(str);
		this.price = p>price ? p: price;	
	}
	
	public void addname(String s){
		if(!this.name.contains(s))
			this.name.add(s);
	}
	
	public double getPrice() {
		return price * name.size();
	}

	public void setPrice(double p) {
		this.price = p>price ? p: price;
	}

	public boolean isVisited() {
		return visited;
	}

	public void setVisited(boolean visited) {
		this.visited = visited;
	}

	public String toString(){
		StringBuffer sb = new StringBuffer();
		Iterator<String> temp_i = name.iterator();
		while(temp_i.hasNext()){
			String str = temp_i.next();
			sb.append(str);
			if(temp_i.hasNext()) sb.append(".");
		}
		return sb.toString();
		
	}
	
	
	
}
